package com.jacobson.huobi.mvp.model

import com.jacobson.core.framework.repository.IRepositoryManager
import com.jacobson.core.mvp.BaseModel
import com.jacobson.huobi.api.InviteUserListApi
import com.jacobson.huobi.entities.InvitedNumberInfo
import com.jacobson.huobi.entities.response.CommonResponse
import com.jacobson.huobi.entities.response.InviteUserPageResponse
import com.jacobson.huobi.mvp.contract.InviteDetailsContract
import io.reactivex.Observable
import javax.inject.Inject

class InviteUserListModel @Inject constructor(
    repositoryManager: IRepositoryManager
) : BaseModel(repositoryManager), InviteDetailsContract.Model {
    private val inviteUserListApi =
        repositoryManager.obtainRetrofitService(InviteUserListApi::class.java)

    override fun loadInviteUserList(page: Int): Observable<InviteUserPageResponse> {
        return inviteUserListApi.loadInviteUserList(page)
    }

    override fun getSharedInfo() : Observable<CommonResponse<InvitedNumberInfo>>{
        return inviteUserListApi.getSharedInfo()
    }

}